package com.hdlang.assists.ad.utils

import com.tencent.mmkv.MMKV

object CacheUtils {

    private fun createMMKV(): MMKV {
        val mmkv = MMKV.mmkvWithID("mmkv", MMKV.MULTI_PROCESS_MODE)
        return mmkv
    }

    fun setInt(key: String, value: Int) {
        val mmkv = createMMKV()
        mmkv.putInt(key, value)
    }

    fun getInt(key: String, defaultValue: Int): Int {
        val mmkv = createMMKV()
        return mmkv.getInt(key, defaultValue)
    }
}